/*
 * Copyright (c) 2019-2025, Jason(yunho.top) All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the yunho.top developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Jason (yunho.top)
 *
 *
 */

package io.yunho.yunho.interview.two.juc;

/**
 * @author : Jason
 * @date : 2020/5/21 11:18
 * @description :
 */
public class TransferValueTest {
    public void changeValue1(int age){
        age=30;
    }
    public void changeValue2(Person person){
        person.setName("xxx");
    }
    public void changeValue3(String str){
        str="xxx";
    }
    public void changeValue4(String str){
        str= str.trim();
    }

    public static void main(String[] args) {
        TransferValueTest transferValueTest = new TransferValueTest();
        int age=20;
        transferValueTest.changeValue1(age);
        System.out.println("age************"+age+"\r\n");
        Person person = new Person("abc");
        transferValueTest.changeValue2(person);
        System.out.println("person name************"+person.getName()+"\r\n");
        String str = "sss";
        transferValueTest.changeValue3(str);
        System.out.println("str************"+str+"\r\n");
        String str1 = new String("kk");
        transferValueTest.changeValue3(str1);
        System.out.println("str1************"+str1+"\r\n");
        String str2 = new String("k k");
        transferValueTest.changeValue4(str2);
        System.out.println("str2************"+str2+"\r\n");
    }
}
